package br.com.ozsolucoes.entity;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.PrimaryKeyJoinColumn;

/**
 * 
 * @author Felipe de Sousa
 * @since 20/09/2013
 * @version 1.0 - 20/09/2013
 * @extends Cliente
 * @implents Serializable Entidade Pessoa Juridica
 * 
 */
@Entity
@NamedQueries({
	@NamedQuery(name = "PJ.consultarPorRazaoSocial",query = "select pj from PessoaJuridica pj where upper(pj.razaoSocial) like :razaoSocial"),
	@NamedQuery(name = "PJ.consultarIdPorRazaoSocial",query = "select pj.id from PessoaJuridica pj where upper(pj.razaoSocial) = :razaoSocial"),
	@NamedQuery(name = "PJ.consultarIdPorCnpj",query = "select pj.id from PessoaJuridica pj where pj.cnpj = :cnpj"),
	@NamedQuery(name = "PJ.consultarPorRazaoSocialAutoComplete",query = "select pj.razaoSocial from PessoaJuridica pj where upper(pj.razaoSocial) like :razaoSocial"),
	@NamedQuery(name = "PJ.consultarPorCnpj", query = "select pj from PessoaJuridica pj where pj.cnpj = :nuCnpj"),
	@NamedQuery(name = "PJ.consultarPorCnpjLista", query = "select pj from PessoaJuridica pj where pj.cnpj like :nuCnpj"),
	@NamedQuery(name = "PJ.verificarExisteCnpj", query = "select pj from PessoaJuridica pj where pj.cnpj = :nuCnpj"),
	@NamedQuery(name = "PJ.consultaPorId" , query = "select pj from PessoaJuridica pj where pj.id = :idCliente"),
	@NamedQuery(name = "PJ.verificarIdCliente" , query = "select pj from PessoaJuridica pj where pj.id = :idCliente") 
	
})
@PrimaryKeyJoinColumn(name = "fk_idCliente", referencedColumnName = "id")
public class PessoaJuridica extends Cliente implements Serializable {

	private static final long serialVersionUID = -319564381750674082L;

	private String cnpj;

	private String razaoSocial;

	private String nomeFantasia;

	public String getCnpj() {
		return cnpj;
	}

	public void setCnpj(String cnpj) {
		this.cnpj = cnpj;
	}

	public String getRazaoSocial() {
		return razaoSocial;
	}

	public void setRazaoSocial(String razaoSocial) {
		this.razaoSocial = razaoSocial;
	}

	public String getNomeFantasia() {
		return nomeFantasia;
	}

	public void setNomeFantasia(String nomeFantasia) {
		this.nomeFantasia = nomeFantasia;
	}
	
	

}
